package com.manage.config;

import com.upyun.RestManager;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Data
@Configuration
@NoArgsConstructor
@AllArgsConstructor
@ConfigurationProperties(prefix = "upyun")
public class UpYunConf {

    /**
     * 存储空间名称
     */
    private String name_space;

    /**
     * 用户名
     */
    private String user_name;

    /**
     * 密码
     */
    private String password;

    /**
     * 地址，用于定位到特别的桶
     */
    private String address;

    @Bean
    public RestManager getRestManager() {
        return new RestManager(name_space, user_name, password);
    }

}
